package com.chenglai.shop.dao;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * 类描述：
 *
 * @author rjh
 * @date 2023/11/10 15:02
 */
@Repository
public class ShopDao {

    @Resource
    private JdbcTemplate jdbcTemplate;

    public List<Map<String, Object>> queryGoodsInfoList() {
        return jdbcTemplate.queryForList("select * from t_goods_info ");
    }

    public Map<String, Object> getShopInfoByShopId(Integer shopId) {
        return jdbcTemplate.queryForMap("select * from t_goods_info where id = ?", shopId);
    }
}
